home *** CD-ROM | disk | FTP | other *** search
- /* RemoveCatalog.c */
- /*
- * RemoveCatalog.c
- * Copyright © 1992-93 Apple Computer Inc. All Rights Reserved.
- */
- #include "DTSSampleCSAM.h"
-
- OSErr
- RemoveCatalog(
- register DTSSampleCSAMInfoPtr infoPtr,
- DirParamBlockPtr pb
- )
- {
- OSErr status;
- register CatalogInfoPtr catalogInfoPtr;
- #define CAT (*catalogInfoPtr)
-
- catalogInfoPtr = (CatalogInfoPtr) INFO.catalogQHdr.qHead;
- while (catalogInfoPtr != NULL) {
- /*
- * Do we need to check for an identical catalog
- * discriminator, too?
- */
- if (OCEEqualCreationID(
- &pb->removeDirectoryPB.directoryRecordCID,
- &CAT.creationID)
- ) {
- /*
- * Do we need to remove the contents of the catalog
- * (such as allocated RStrings, for example)?
- */
- status = Dequeue((QElemPtr) catalogInfoPtr, &INFO.catalogQHdr);
- /*
- * Now that the catalog has been deleted, should we free up the
- * memory it has allocated? If so, remember that this routine must
- * not be called from an I/O completion or an interrupt routine.
- */
- goto exit;
- }
- catalogInfoPtr = (CatalogInfoPtr) CAT.qLink;
- }
- /*
- * Fell off the end of the list: this "can't" happen.
- */
- status = qErr; /* Element not found */
- exit: ;
- LogStatus('RemD', status, "\pRemoveCatalog exit");
- return (status);
- }
-